<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src=""></script>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script>
        function  registerforAjax(){
        $.ajax({
            url:"register",
            method:"post",
            data:$("#f1").serialize(), //表单序列化
            success:function (result){
               if(result=="1")
                   alert("注册成功")
                else
                    alert("注册失败")
            }
        });
        }

    </script>
</head>
<body>
<a href="register">同步请求</a>
<a href="javascript:registerforAjax()">异步请求</a>
<hr>
<div>
    <form id="f1" name="f1" action="register" method="post">
    用户名:<input type="text" id="uname" name="uname" placeholder="请输入用户名"><br>
    密码：<input type="password" id="upwd" name="upwd" placeholder="请输入密码"><br>
    确认密码：<input type="password" id="rupwd" name="rupwd" placeholder="请输入确认密码"><br>
{#    <a href="javascript:f1.submit()">注册</a>#}
    <a href="javascript:registerforAjax()">注册</a>
    <a href="javascript:f1.reset()">重置</a>
        </form>
</div>
</body>
</html>